// 指标考核>>>>指标变更 or 考核对象变更
import request from '@/router/axios'
// 查询列表
export function examineList(obj, type) {
  return request({
    url: `/appr-event/routineAssessKpi/page/${type}`,
    method: 'get',
    params: obj
  })
}

// 查询默认启动的考核
export function defaultList(obj) {
  return request({
    url: '/appr-event/routineAssess/default',
    method: 'get',
    params: obj
  })
}

// 拟定推送
export function proposedPush(ids, otherUserId) {
  return request({
    url: `/appr-event/routineAssessKpi/process/push/${ids}/${otherUserId}`,
    method: 'put',
  })
}

// 删除考核
export function deleteExamin(ids) {
  return request({
    url: `/appr-event/routineAssess/${ids}`,
    method: 'delete',
  })
}

// 通过id查询详情
export function examinDetail(id) {
  return request({
    url: `/appr-event/routineAssess/${id}`,
    method: 'get',
  })
}

//获取个人指标项目
export function getNormByTypeAndUserId(participantId) {
  return request({
    url:`/appr-event/routineAssessKpiDetail/item/detail/${participantId}`,
    method: 'get',
  })
}


// 新增考核
export function addExamin(obj) {
  return request({
    url: '/appr-event/routineAssessKpi',
    method: 'post',
    data: obj
  })
}

// 编辑考核
export function editExamin(obj) {
  return request({
    url: '/appr-event/routineAssessKpi/item/updateItem',
    method: 'put',
    data: obj
  })
}

// 变更人员
export function changePerson(obj) {
  return request({
    url: '/appr-event/routineAssessKpi/process/userchange',
    method: 'put',
    data: obj
  })
}

//日志列表
export function logList(obj) {
  return request({
    url: `/appr-event/routineAssessKpiLogs/page`,
    method: 'get',
    params: obj
  })
}

// 验证指标是否重复
export function checkitem(assessParticipantId, normIds) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/checkitem/${assessParticipantId}/${normIds}`,
    method: 'get',
  })
}
